package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.LogBean;
import com.project.service.ILogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("log")
@Api(tags = "日志控制层")
public class LogController {
    @Autowired
    private ILogService logService;

    /**
     * 分页动态查询日志信息
     * @param pageNO 页码
     * @param startDate 起始日期
     * @param endDate 结束日期
     * @return 分页对象
     */
    @ApiOperation(value = "页动态查询日志信息")
    @GetMapping("cutByItem")
    public IPage<LogBean> cutByItem(Integer pageNO,
                             LocalDate startDate, LocalDate endDate){
        return logService.cutByItem(pageNO, startDate, endDate);
    }
}
